<%--
  Created by IntelliJ IDEA.
  User: libing
  Date: 2016/7/23
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib uri="http://www.rapid-framework.org.cn/rapid" prefix="rapid" %>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.1.10.1.min.js"></script>
    <style type="text/css">
        #customers
        {
            font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
            width:99.9%;
            border-collapse:collapse;
        }

        #itemsForm{
            font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
            width:79.9%;
            border-collapse:collapse;
            float: left;
            margin-top: 50px;
        }

        #itemsForm td,#itemsForm tr{
            font-size:1em;
            border:1px solid #98bf21;
            padding:10px 7px 10px 7px;
            text-align: center;
            color: #000;
        }
        #customers td, #customers tr
        {
            font-size:1em;
            border:1px solid #98bf21;
            padding:10px 7px 10px 7px;
            text-align: center;
            color: #000;
        }
        #page{
            float:right;
            margin-right:100px;
            margin-top:30px;
        }

        #page ul{
            height:25px;
        }
        #page ul li{
            height:25px;
            line-height:25px;
            text-align:center;
            padding: 3px;
            border:1px rgba(0,0,0,0.4) solid;
            background:rgba(0,0,0,0.4);
            border-radius:4px;
            -moz-border-radius:4px;/* Old Firefox */
            float:left;
            display:inline;
            margin: auto 15px;
        }
        #page a:hover{
            color:#fff;
        }
        td a {
            color: #198BD4;
        }
        td a:hover{
            color: black;
        }

    </style>

    <script type="text/javascript">
        function deleteItems(){
            document.itemsForm.action="";
            document.itemsForm.submit();
        }
        function changeStatus() {
            if($('#status_click').val() == "封号")
            {
                $('#status').innerHTML("状态正常");
                $('#status_click').innerHTML("封号");
            }
            else {
                $('#status').innerHTML("已封号");
                $('#status_click').innerHTML("解封");
            }
        }
    </script>

</head>
<body>
<%--<rapid:override name="top">
这里如果不想改变父页面的内容的话，就不要写出来了，否则会认为你重写了父页面的这个top
</rapid:override>--%>

<%! String currentPage = "1"; %>
<%! String nextPage = String.valueOf(Integer.valueOf(currentPage)+1);%>
<%! int upPage =1;%>
<div class="container clearfix">

    <rapid:override name="main_wrap">

        <form name="itemsForm" action="" method="post" id="itemsForm">
            <table width="100%" border=1>
                <tr>
                    <td>公司名称：<input type="text" name="itemsCustom.name"/></td>
                    <td>
                        <input type="submit" value="查询"/>
                        <input type="button" value="批量删除" onclick="deleteItems()"/>
                    </td>
                </tr>
            </table>


        <table align="center" class="main_wrap_table" id="customers" width="300%">
            <tr>
                <td>选择</td>
                <td>id</td>
                <td>公司名称</td>
                <td>公司联系人</td>
                <td>联系电话</td>
                <td>状态</td>
                <td>操作</td>
            </tr>

            <c:forEach items="${list}" var="lists">
                <tr>
                    <td><input type="checkbox" name="items_id" value="${lists.companydetailId }"></td>
                    <td>${lists.companydetailId }</td>
                    <td>${lists.company.companyName }</td>
                    <td>${lists.company.contacterName}</td>
                    <td>${lists.company.telephoneNum }</td>
                    <td id="status" class="status_c">
                    <c:choose>
                        <c:when test="${lists.company.sStatus == 0}">
                            正常状态
                        </c:when>
                        <c:otherwise>
                            已被封号
                        </c:otherwise>
                    </c:choose>
                    </td>
                    <td><a href="">详情</a> | <a href="${pageContext.request.contextPath }/admin/changeStatus.action?page=<%= currentPage %>&status=${lists.company.sStatus}&id=${lists.companyId}" class="status_class" id="status_click">                    <c:choose>
                        <c:when test="${lists.company.sStatus == 0}">
                            封号
                        </c:when>
                        <c:otherwise>
                            解号
                        </c:otherwise>
                    </c:choose></a>
                    </td>

                </tr>
            </c:forEach>

        </table>



        <div id="page">
            <ul>
                <li class="first"><a href="${pageContext.request.contextPath }/admin/returnCompanyInfos.action?page=1">&nbsp;首页&nbsp;</a></li>
                <li class="upPage"><a href="${pageContext.request.contextPath }/admin/returnCompanyInfos.action?page=<%= currentPage %>">&nbsp;上一页&nbsp;</a></li>
                <li class="nextPage"><a href="${pageContext.request.contextPath }/admin/returnCompanyInfos.action?page=<%= nextPage %>">&nbsp;下一页&nbsp;</a></li>
                <li class="lastPage"><a href="#">&nbsp;末页&nbsp;</a></li>
            </ul>
        </div>
    </rapid:override>



</div>

</body>
</html>
<%@include file="../common/templateJSP.jsp"%>
